home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / mc51bugs.zip / Q32744 < prev    next >
Text File  |  1988-07-21  |  895b  |  37 lines

  1. Q32744 Compiler Generates Protection Violation
  2. C Compiler
  3. 5.10   | 5.10
  4. MS-DOS | OS/2
  5.  
  6. Summary:
  7.    When you attempt to compile the following piece of code in OS/2, the
  8. compiler will generate a protection violation.
  9.    Microsoft has confirmed this to be a problem in Version 5.10. We
  10. are researching this problem and will post new information as it
  11. becomes available.
  12.    The code has logic that is probably not wanted; correcting it will
  13. allow it to compile. Currently the for loop reads as follows:
  14.  
  15. for (i = NAME_LEN-1;i = 0; i--)
  16.  
  17. when you probably meant it to read:
  18.  
  19. for (i = NAME_LEN-1;i != 0 ; i--)
  20.  
  21. More Information:
  22.    The following is a code example:
  23.  
  24. #define NAME_LEN 9
  25. main()
  26. {
  27.    int i;
  28.    char name[NAME_LEN];
  29.  
  30.       for ( i = NAME_LEN-1; i = 0; i-- )
  31.         if (name[i] == ' ') name[i] = '\0';
  32. }
  33.  
  34.  
  35. Keywords:  buglist5.10
  36. Updated  88/07/21 03:19
  37.